package com.pic.mgt.monitor.parser;

import com.pic.mgt.monitor.WrongUnitFormatException;

public abstract class FormatParser {
	
	protected void checkObjectType(Object obj, Class c)
							throws WrongUnitFormatException{
		if (!c.isInstance(obj)) {
			throw new WrongUnitFormatException(
					"Parameter '" + obj +
					"' error, must be '" + c.getName() + "' only.");
		}
	}
	
	public abstract Object parse(Object obj)
					throws WrongUnitFormatException;
}
